/**
 * 
 */
package com.ternnetwork.batch.listener.campaign;



import javax.annotation.Resource;

import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;

import com.ternnetwork.batch.enums.BatchStepDataCountStatus;
import com.ternnetwork.batch.enums.BatchStepDataType;
import com.ternnetwork.batch.service.commons.BatchStepDataCountService;




public class BpInfoCollectionDataSendSmsStepExecutionListener implements StepExecutionListener {


	@Resource
	private BatchStepDataCountService batchStepDataCountService;
	

	public void beforeStep(StepExecution stepExecution) {
		
	
	}

	
	public ExitStatus afterStep(StepExecution stepExecution) {
		String batchNo=stepExecution.getJobParameters().getString("batchNo");
		batchStepDataCountService.idoAdd(stepExecution.getWriteCount(), stepExecution.getCommitCount(), stepExecution.getFilterCount(), stepExecution.getReadCount(), stepExecution.getRollbackCount(), stepExecution.getSkipCount(), stepExecution.getProcessSkipCount(), stepExecution.getReadSkipCount(), stepExecution.getWriteSkipCount(), batchNo, BatchStepDataType.TYPE_2, BatchStepDataCountStatus.CHECKED);
		return stepExecution.getExitStatus();
	}

}
